const mongoose = require('mongoose');
const baseModel = require('./base-model');

const videoLikeSchema = new mongoose.Schema({
  user: {
    type: mongoose.ObjectId,
    required: true,
    ref: 'User' // 与用户模型关联
  },
  video: {
    type: mongoose.ObjectId,
    required: true,
    ref: 'Video' // 与video模型关联
  },
  like: {
    type: Number,
    enum: [1, -1],
    required: true
  },
  ...baseModel
});

module.exports = videoLikeSchema;
